<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: l
  Date: 2023/6/23
  Time: 9:42
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>首页</title>
</head>
<link rel="stylesheet" href="css/base.css">
<link rel="stylesheet" href="css/index.css">
<script src="js/index.js"></script>

<body>
<div class="container">
    <!-- 头部 -->
    <header>
        <div class="nav-top">
            <a href="shang_person.jsp">
                <img src="../upload/${name.photo}" alt="" class="person">
            </a>
            <!-- 个人、搜索、退出 -->
            <div class="search">
                <form action="/shang/shang_index" method="get">
<%--                    <img src="img/search.png" alt="">--%>
                    <input type="text" name="keyword" class="search-text" placeholder="搜索商品">
                    <input type="submit" value="搜索" maxlength="6" class="search-img">
                </form>
            </div>
             <a href="#">
                 <img src="img/exit.png" alt="" class="exit" id="isexit">
             </a>
        </div>

    </header>
    <!-- 已上架商品 -->
    <div class="products-list">
        <div class="title">已上架商品</div>
        <c:forEach var="p" items="${product}">
        <c:if test="${p.state == '0'}">
        <div class="product">
            <img src="../upload/${p.photo}" alt="">
            <div class="product-info">
                <p class="product-name">${p.name}</p>
                <div class="label">
                    <div class="listed-label">已上架</div></br>
                    <div class="district-server-label">${p.game}</div>
                </div>
                <div class="product-bot">
                    <p class="product-price">￥${p.price}</p>
                    <div class="purchase"><a href="/shang/shang_buyProduct?id=${p.id}" style="color: white">购买</a></div>
                </div>
                <div class="from">
                    @${p.username} <c:if test="${p.userId.equals(name.id)}"><a href="/shang/shang_updownProduct?id=${p.id}" style="color: red; margin-right: 15px; float: right">下架</a></c:if>
                </div>
            </div>
        </div>
        </c:if>
        </c:forEach>
    </div>
</div>
</body>

</html>

